package com.minio.miniospringboot.common;

import lombok.Builder;
import lombok.Data;
import lombok.ToString;

/**
 * @ClassName: Result
 * @Desc: TODO
 * @auther: <Bang>
 * @Date: 2023/03/17 15:08
 * @Version: 1.0
 * @Modified By:
 */
@Data
@ToString
@Builder
public class Res<T> {


    private String msg;
    private T data;
    private String code;


    public static <T> Res error(String msg) {
        return new ResBuilder<T>().code("500").msg(msg).build();
    }

    public static <T> Res ok(String msg, T data) {
        return new ResBuilder<T>().code("0").msg(msg).data(data).build();
    }
}
